package com.jeespring.chapter01.section02;

class MyThread02 extends Thread{
	public void run() {
		try {
			for (int i = 0; i < 10; i++) {
				int time = (int) (Math.random()*1000);
				Thread.sleep(time);
				System.out.println("run=" + Thread.currentThread().getName());
			}
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
}
public class Thread02{
	public static void main(String[] args) {
		try {
			MyThread02 myThread02 = new MyThread02();
			myThread02.setName("MyThread02");
			myThread02.start();
			for (int i = 0; i < 10; i++) {
				int time = (int) (Math.random()*1000);
				Thread.sleep(time);
				System.out.println("run=" + Thread.currentThread().getName());
			}
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
}
